package com.itheima.threadtest5;

import java.util.ArrayList;
import java.util.Collections;

/**
 * 抽奖
 * 有一个抽奖池   里面有 {10 , 5 , 3 , 2 }...
 * 创建两个抽奖箱 随机的从抽奖池中抽元素并打印
 */
public class ThreadDemo {

    public static void main(String[] args) {
        //创建奖池
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list , 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 , 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36);

        MyThread t1 = new MyThread(list);
        MyThread t2 = new MyThread(list);

        t1.setName("线程1");
        t2.setName("线程2");

        t1.start();
        t2.start();
    }
}
